// ============================================================================
//
// Copyright (C) 2006-2007 Dengues
//
// Google Group: http://groups.google.com/group/dengues
// QQ Group: 24885404
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ============================================================================
package org.dengues.core.process;

import org.dengues.core.i18n.Messages;

/**
 * Qiang.Zhang.Adolf@gmail.com class global comment. Detailled comment <br/>
 * 
 * $Id: Dengues.epf 2008-1-7 qiang.zhang $
 * 
 */
public enum EConnectionType {
    DATA(Messages.getString("EConnectionType.data"), Messages.getString("GEFEditorContextMenuProvider.row"), "250;100;100"), //$NON-NLS-1$ //$NON-NLS-2$
    MAIN(Messages.getString("EConnectionType.main"), Messages.getString("GEFEditorContextMenuProvider.row"), "100;250;150"), //$NON-NLS-1$ //$NON-NLS-2$

    TRG_OK(Messages.getString("EConnectionType.ifOk"), Messages.getString("EConnectionType.trigger"), "100;100;250"); //$NON-NLS-1$ //$NON-NLS-2$

    private String displayName;

    private String itemName;

    private String rgb;

    /**
     * Qiang.Zhang.Adolf@gmail.com EConnectionType constructor comment.
     * 
     * @param displayName
     * @param itemName
     * @param rgb
     */
    EConnectionType(String displayName, String itemName, String rgb) {
        this.displayName = displayName;
        this.itemName = itemName;
        this.rgb = rgb;
    }

    /**
     * Getter for displayName.
     * 
     * @return the displayName
     */
    public String getDisplayName() {
        return this.displayName;
    }

    /**
     * Qiang.Zhang.Adolf@gmail.com Comment method "getType".
     * 
     * @param name
     * @return
     */
    public static EConnectionType getType(String name) {
        for (EConnectionType ctype : values()) {
            if (ctype.toString().equals(name)) {
                return ctype;
            }
        }
        return MAIN;
    }

    /**
     * Getter for itemName.
     * 
     * @return the itemName
     */
    public String getItemName() {
        return this.itemName;
    }

    /**
     * Getter for rgb.
     * 
     * @return the rgb
     */
    public String getRgb() {
        return this.rgb;
    }
}
